﻿using System;
using System.Collections.Generic;
using Utility = Microsoft.Sample.Outlook.Utility;
using MSOutlook = Microsoft.Office.Interop.Outlook;

namespace Microsoft.Sample.Outlook.CRMIntegration
{
    
    
    public partial class CrmDataSet {

		[Utility.OutlookFolderSync("Name")]
		partial class AccountsRow : Utility.IOutlookSyncItem
		{
			string Utility.IOutlookSyncItem.EntryID
			{
				get { return this.OutlookID; }
				set { this.OutlookID = value; }
			}
		}

		[Utility.OutlookItemSync(MSOutlook.OlItemType.olTaskItem)]
		[Utility.OutlookCustomSyncInfo("GetSyncInfo")]
		partial class ActivitiesRow : Utility.IOutlookSyncItem
		{
			string Utility.IOutlookSyncItem.EntryID
			{
				get { return this.OutlookID; }
				set { this.OutlookID = value; }
			}

			public static IDictionary<string, Utility.OutlookFieldSyncAttribute> GetSyncInfo()
			{
				Dictionary<string, Utility.OutlookFieldSyncAttribute> syncInfo = new Dictionary<string, Utility.OutlookFieldSyncAttribute>();
				syncInfo.Add("Name", new Utility.OutlookFieldSyncAttribute("Subject"));
                syncInfo.Add("Comments", new Utility.OutlookFieldSyncAttribute("Body"));
				syncInfo.Add("DateNullCheck", new Utility.OutlookFieldSyncAttribute("DueDate"));

				return syncInfo;
			}

			public DateTime? DateNullCheck
			{
				get 
				{
					if (this.IsDueDateNull())
						return null;

					return this.DueDate; 
				}
			}

		}
	
		[Utility.OutlookItemSync(MSOutlook.OlItemType.olPostItem)]
		[Utility.OutlookCustomSyncInfo("GetSyncInfo")]
		partial class OpportunitiesRow : Utility.IOutlookSyncItem
		{
			string Utility.IOutlookSyncItem.EntryID
			{
				get { return this.OutlookID; }
				set { this.OutlookID = value; }
			}

			public static IDictionary<string, Utility.OutlookFieldSyncAttribute> GetSyncInfo()
			{
				Dictionary<string, Utility.OutlookFieldSyncAttribute> syncInfo = new Dictionary<string, Utility.OutlookFieldSyncAttribute>();
				syncInfo.Add("Name", new Utility.OutlookFieldSyncAttribute("Subject"));
                syncInfo.Add("Notes", new Utility.OutlookFieldSyncAttribute("Body"));
				syncInfo.Add("SalesStage", new Utility.OutlookFieldSyncAttribute("SalesStage", true));

				return syncInfo;
			}
		}

		[Utility.OutlookItemSync(MSOutlook.OlItemType.olContactItem)]
		[Utility.OutlookCustomSyncInfo("GetSyncInfo")]
		partial class ContactsRow : Utility.IOutlookSyncItem
		{
			string Utility.IOutlookSyncItem.EntryID
			{
				get { return this.OutlookID; }
				set { this.OutlookID = value; }
			}

			public static IDictionary<string, Utility.OutlookFieldSyncAttribute> GetSyncInfo()
			{
				Dictionary<string, Utility.OutlookFieldSyncAttribute> syncInfo = new Dictionary<string, Utility.OutlookFieldSyncAttribute>();
				syncInfo.Add("FirstName", new Utility.OutlookFieldSyncAttribute("FirstName"));
				syncInfo.Add("LastName", new Utility.OutlookFieldSyncAttribute("LastName"));
				syncInfo.Add("JobTitle", new Utility.OutlookFieldSyncAttribute("JobTitle"));
				syncInfo.Add("Department", new Utility.OutlookFieldSyncAttribute("Department"));
				syncInfo.Add("Address", new Utility.OutlookFieldSyncAttribute("BusinessAddressStreet"));
				syncInfo.Add("City", new Utility.OutlookFieldSyncAttribute("BusinessAddressCity"));
				syncInfo.Add("StateRegion", new Utility.OutlookFieldSyncAttribute("BusinessAddressState"));
				syncInfo.Add("PostalCode", new Utility.OutlookFieldSyncAttribute("BusinessAddressPostalCode"));
				syncInfo.Add("Country", new Utility.OutlookFieldSyncAttribute("BusinessAddressCountry"));
				syncInfo.Add("OfficePhone", new Utility.OutlookFieldSyncAttribute("BusinessTelephoneNumber"));
				syncInfo.Add("OfficeFax", new Utility.OutlookFieldSyncAttribute("BusinessFaxNumber"));
				syncInfo.Add("MobilePhone", new Utility.OutlookFieldSyncAttribute("MobileTelephoneNumber"));
                syncInfo.Add("Comments", new Utility.OutlookFieldSyncAttribute("Body"));

				return syncInfo;
			}
		}


	}
}
